package com.wish.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wish.dto.BusinessDto;
import com.wish.entity.Business;
import com.wish.mapper.BusinessMapper;
import com.wish.service.IBusinessService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 商户表 服务实现类
 * </p>
 *
 * @author 五组
 * @since 2021-03-22
 */
@Service
public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, Business> implements IBusinessService {
    @Resource
    private BusinessMapper businessMapper;
    @Override
    public Page<Business> getList(Page<Business> page) {
        return businessMapper.getList(page);
    }

    @Override
    public PageInfo<Business> tolist(BusinessDto dto) {
        PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
        List<Business> list = baseMapper.tolist();
        return new PageInfo<Business>(list);
    }
}
